import request from '@/utils/request'

// 查询订单信息列表
export function listOrderinfo(query) {
  return request({
    url: '/orderEat/orderInfo/zList',
    method: 'get',
    params: query
  })
}

// 查询订单信息详细
export function getOrderDetail(orderId) {
  return request({
    url: '/orderEat/orderInfo/getOrderDetail/' + orderId,
    method: 'get'
  })
}

// 新增订单信息
export function addOrderinfo(data) {
  return request({
    url: '/orderEat/orderInfo',
    method: 'post',
    data: data
  })
}

// 修改订单信息
export function updateOrderinfo(data) {
  return request({
    url: '/orderEat/orderInfo',
    method: 'put',
    data: data
  })
}

// 修改主订单详情信息
export function updateOrderDetail(data) {
  return request({
    url: '/orderEat/orderInfo/editOrderDetail',
    method: 'post',
    data: data
  })
}

// 修改追加订单详情信息
export function updateOrderAssociatedDetail(data) {
  return request({
    url: '/orderEat/orderInfo/editOrderAssociate',
    method: 'post',
    data: data
  })
}

// 删除订单信息
export function delOrderinfo(orderId) {
  return request({
    url: '/orderEat/orderInfo/deleteOrderInfo/' + orderId,
    method: 'post'
  })
}

// 删除追加订单信息
export function delOrderAssociate(orderId) {
  return request({
    url: '/orderEat/orderInfo/deleteOrderAssociate/' + orderId,
    method: 'post'
  })
}

// 结算订单
export function settlement(data) {
  return request({
    url: '/orderEat/orderInfo/toSettlement',
    method: 'post',
    data: data
  })
}
